package org.apache.james.mime4j.parser;

public final class Event
{
  public static final Event HEADERS_PREMATURE_END;
  public static final Event INALID_HEADER;
  public static final Event MIME_BODY_PREMATURE_END = new Event("Body part ended prematurely. Boundary detected in header or EOF reached.");
  private final String code;

  static
  {
    HEADERS_PREMATURE_END = new Event("Unexpected end of headers detected. Higher level boundary detected or EOF reached.");
    INALID_HEADER = new Event("Invalid header encountered");
  }

  public Event(String paramString)
  {
    if (paramString == null)
      throw new IllegalArgumentException("Code may not be null");
    this.code = paramString;
  }

  public boolean equals(Object paramObject)
  {
    boolean bool;
    if (paramObject == null)
      bool = false;
    while (true)
    {
      while (true)
      {
        while (true)
        {
          return bool;
          if (this != paramObject)
            break;
          bool = true;
        }
        if (!(paramObject instanceof Event))
          break;
        Event localEvent = (Event)paramObject;
        bool = this.code.equals(localEvent.code);
      }
      bool = false;
    }
  }

  public int hashCode()
  {
    return this.code.hashCode();
  }

  public String toString()
  {
    return this.code;
  }
}